package com.it.tydic.estate.module.controller.cwgl;

import com.it.tydic.estate.common.annotation.ControllerDesc;
import com.it.tydic.estate.common.aop.Result;
import com.it.tydic.estate.common.constants.LogConstants;
import com.it.tydic.estate.module.controller.common.LoginController;
import com.it.tydic.estate.module.model.inner.TbCwsf;
import com.it.tydic.estate.module.service.TbCwsfService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @description:   车位收费管理Controller
 * @author: zhangshuo
 * @createDate: 2020/03/04
 * @version: 1.0
 */
//@Api(value = "车位收费管理数据接口",description = "车位管理———车位收费管理 ")
@Api(tags ="车位管理———车位收费管理")
@RestController("/tbcwsf")
public class TbCwsfController {
    @Autowired
   private TbCwsfService tbCwsfService;
    private static final Logger logger=  LoggerFactory.getLogger(LoginController.class);

    /*车位档案模糊查询*/
    @PostMapping ("/selectBysfPage")
    @ApiOperation(value = "条件查询车位收费", notes = "条件查询车位收费")
    public Result selectBysfPage(@RequestBody Map<String,Object> tbCwsf) {
        logger.info("sucess");
        return tbCwsfService.selectBysfPage(tbCwsf);
    }
    /*车位档案批量删除*/
    @PostMapping ("/deleteByTbCwsf")
    @ControllerDesc(description = LogConstants.delete_data)
    @ApiOperation(value = "车位收费批量删除", notes = "车位收费批量删除")
    public Result deleteByTbCwsf(@RequestBody List<String> list) {
        logger.info("sucess");
        return tbCwsfService.deleteByTbCwsf(list);
    }
    /*车位档案新增或修改*/
    @PostMapping ("/insertTbCwsfOrUpdata")
    @ControllerDesc(description = LogConstants.addOrUpdate_data)
    @ApiOperation(value = "车位收费新增或修改", notes = "车位收费新增或修改")
    public Result insertTbCwsfOrUpdata(@RequestBody TbCwsf tbCwsf) {
        logger.info("sucess");
        return tbCwsfService.insertTbCwsfOrUpdata(tbCwsf);
    }

    /*根据车位ID查询车位收费信息*/
    @PostMapping ("/selectCwsfBycwid")
    @ApiOperation(value = "根据车位ID查询车位收费信息", notes = "根据车位ID查询车位收费信息")
    public Result selectCwsfBycwid(@RequestBody List<String> list) {
        logger.info("sucess");
        return tbCwsfService.selectCwsfBycwid(list);
    }

}
